import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
  RouteRecordRaw,
} from "vue-router";
// import HomeView from "../views/HomeView.vue";
import ItemSummaryPriceView from "../views/ItemSummaryPriceView.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "home",
    component: ItemSummaryPriceView,
  },
  {
    path: "/price",
    name: "price",
    component: () => import("../PriceApp.vue"),
  },
  {
    path: "/standard",
    name: "standard",
    component: () => import("../views/StandardDocView.vue"),
  },
  {
    path: "/standard/list",
    name: "standardList",
    component: () => import("../views/StandardDocListView.vue"),
    props: true,
  },
  {
    path: "/about",
    name: "about",
    component: () => import("../views/AboutView.vue"),
  },
  {
    path: "/bomPrice",
    name: "BomPrice",
    component: () => import("../views/BomPriceView.vue"),
  },
  {
    path: "/priceComparison",
    name: "PriceComparison",
    component: () => import("../views/ItemPriceComparisonView.vue"),
  },
  {
    path: "/sumReport",
    name: "SumReport",
    component: () => import("../views/ItemSummaryReportView.vue"),
  },
  {
    path: "/detailReport",
    name: "DetailReport",
    component: () => import("../views/ItemDetailReportView.vue"),
  },
  {
    path: "/standardDoc",
    name: "StandardDoc",
    component: () => import("../views/StandardDocView.vue"),
  },
  {
    path: "/platform/designPartList",
    name: "StandardDoc",
    component: () => import("../views/DesignPartListView.vue"),
  },
  {
    path: "/delr",
    name: "DesignEvaluationImplementationReport",
    component: () =>
      import("../views/DesignEvaluationImplementationReport.vue"),
  },
  {
    path: "/blame",
    name: "BlameView",
    component: () => import("../views/BlameView.vue"),
  },
  {
    path: "/blame/reply",
    name: "BlameReplyFormView",
    component: () => import("../views/BlameReplyFormView.vue"),
  },
  {
    path: "/residuals",
    name: "ResidualsView",
    component: () => import("../views/ResidualsView.vue"),
  },
  // {
  //   path: "/summaryPrice",
  //   name: "SummaryPrice",
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () =>
  //     import(
  //       /* webpackChunkName: "about" */ "../views/ItemSummaryPriceView.vue"
  //     ),
  // },
];

// const router = createRouter({
//   history: createWebHistory(process.env.BASE_URL),
//   routes,
// });
const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes,
});

router.beforeEach((to, from, next) => {
  console.log("to ==> ", to);
  console.log("from ==> ", from);
  next();
});
export default router;
